Versioning your assets in WordPress is relatively straight-forward as the wp_register_script()
and wp_register_style()
functions both offer support for specifying a version as a function parameter.
It’s easy to use because you simply pass it a value but it’s also simple to forget which could result in site visitors loading up stale versions of CSS and JS from a cache.
Thankfully, PHP provides us with an easy method of ensuring the version parameter changes whenever the file changes.